package com.atguigu04.override;

/**
 * ClassName: Student
 * Package: com.atguigu03
 * Description:
 *
 * @Author ZY
 * @Create 20:10
 * @Version 1.0
 */
public class Student extends Person {

//    String name;
//    int age;

    String school;

//    public void eat(){
//        System.out.println("人吃饭");
//    }
//
//    public void sleep(){
//        System.out.println("人睡觉");
//    }

    public void study(){
        System.out.println("学习");
    }

    public void eat(){
        System.out.println(name + "应该多吃饭");
    }

    public void show1(){
        //1.拿到了age，但因为设置了private，所以不能访问age
//        System.out.println("age = " + age);
        //2.调用getAge()方法可以访问age
        System.out.println("age = " + getAge());
    }
}
